package com.his.his_system.domain;

import com.baomidou.mybatisplus.annotation.IdType;
import com.baomidou.mybatisplus.annotation.TableField;
import com.baomidou.mybatisplus.annotation.TableId;
import com.baomidou.mybatisplus.annotation.TableName;
import java.io.Serializable;
import java.util.List;

import lombok.Data;

/**
 * 科室表
 * @TableName dzm_his_department
 */
@TableName(value ="dzm_his_department")
@Data
public class DzmHisDepartment implements Serializable {
    /**
     * 科室id
     */
    @TableId(type = IdType.AUTO)
    private Long did;

    /**
     * 创建时间
     */
    private Object createTime;

    /**
     * 编辑时间
     */
    private Object updateTime;

    /**
     * 科室名称
     */
    private String departmentName;

    /**
     * 科室编号
     */
    private String departmentNumber;

    /**
     * 医院id
     */
    private Integer hid;

    /**
     * 后添加的
     */
    @TableField(exist = false)
    private List<DzmHisDoctor> doctorList;

    public List<DzmHisDoctor> getDoctorList() {
        return doctorList;
    }

    public void setDoctorList(List<DzmHisDoctor> doctorList) {
        this.doctorList = doctorList;
    }

    @TableField(exist = false)
    private static final long serialVersionUID = 1L;

    @Override
    public boolean equals(Object that) {
        if (this == that) {
            return true;
        }
        if (that == null) {
            return false;
        }
        if (getClass() != that.getClass()) {
            return false;
        }
        DzmHisDepartment other = (DzmHisDepartment) that;
        return (this.getDid() == null ? other.getDid() == null : this.getDid().equals(other.getDid()))
            && (this.getCreateTime() == null ? other.getCreateTime() == null : this.getCreateTime().equals(other.getCreateTime()))
            && (this.getUpdateTime() == null ? other.getUpdateTime() == null : this.getUpdateTime().equals(other.getUpdateTime()))
            && (this.getDepartmentName() == null ? other.getDepartmentName() == null : this.getDepartmentName().equals(other.getDepartmentName()))
            && (this.getDepartmentNumber() == null ? other.getDepartmentNumber() == null : this.getDepartmentNumber().equals(other.getDepartmentNumber()))
            && (this.getHid() == null ? other.getHid() == null : this.getHid().equals(other.getHid()));
    }

    @Override
    public int hashCode() {
        final int prime = 31;
        int result = 1;
        result = prime * result + ((getDid() == null) ? 0 : getDid().hashCode());
        result = prime * result + ((getCreateTime() == null) ? 0 : getCreateTime().hashCode());
        result = prime * result + ((getUpdateTime() == null) ? 0 : getUpdateTime().hashCode());
        result = prime * result + ((getDepartmentName() == null) ? 0 : getDepartmentName().hashCode());
        result = prime * result + ((getDepartmentNumber() == null) ? 0 : getDepartmentNumber().hashCode());
        result = prime * result + ((getHid() == null) ? 0 : getHid().hashCode());
        return result;
    }

    @Override
    public String toString() {
        StringBuilder sb = new StringBuilder();
        sb.append(getClass().getSimpleName());
        sb.append(" [");
        sb.append("Hash = ").append(hashCode());
        sb.append(", did=").append(did);
        sb.append(", createTime=").append(createTime);
        sb.append(", updateTime=").append(updateTime);
        sb.append(", departmentName=").append(departmentName);
        sb.append(", departmentNumber=").append(departmentNumber);
        sb.append(", hid=").append(hid);
        sb.append(", serialVersionUID=").append(serialVersionUID);
        sb.append(", doctorlist=").append(doctorList);
        sb.append("]");
        return sb.toString();
    }
}
